import { createElement, HTMLAttributes, type FC } from 'react';
import classNames from 'classnames';

import { feedLabelDefaultProps } from './defaultProps';
import type { FeedLabelOptions } from './type';

export interface FeedLabelProps extends FeedLabelOptions, HTMLAttributes<HTMLDivElement> {}

const FeedLabel: FC<FeedLabelProps> = (props) => {
  const { className, children, forwardedRef, ...feedLabelProps } = props;

  return createElement(
    'div',
    { ref: forwardedRef, className: classNames('label', className), ...feedLabelProps },
    children,
  );
};

FeedLabel.displayName = 'FeedLabel';
FeedLabel.defaultProps = feedLabelDefaultProps;

export default FeedLabel;
